﻿using System.Collections.Generic;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
using Microsoft.Xna.Framework.Content.Pipeline.Processors;
using Microsoft.Xna.Framework.Graphics;

namespace Phoenix.Xna.Framework.ContentPipeline.Models
{
    [ContentSerializerRuntimeType("Phoenix.Xna.Framework.Graphics.Models.InstancedModel, Phoenix.Xna.Framework")]
    public class InstancedModelContent
    {
        [ContentSerializer]
        private List<InstancedModelPart> _modelParts = new List<InstancedModelPart>();

        public void AddModelPart(int indexCount, int vertexCount, int vertexStride, VertexElement[] vertexElements,
            VertexBufferContent vertexBufferContent, IndexCollection indexCollection, MaterialContent materialContent)
        {
            InstancedModelPart modelPart = new InstancedModelPart();
            modelPart.IndexCount = indexCount;
            modelPart.VertexCount = vertexCount;
            modelPart.VertexStride = vertexStride;
            modelPart.VertexElements = vertexElements;
            modelPart.VertexBufferContent = vertexBufferContent;
            modelPart.IndexCollection = indexCollection;
            modelPart.MaterialContent = materialContent;
            _modelParts.Add(modelPart);
        }
    }
}
